package rrrmai.viewmodel;

import android.arch.lifecycle.ViewModel;
import android.arch.lifecycle.ViewModelProvider;
import android.support.annotation.NonNull;

import javax.inject.Inject;

import rrrmai.repository.PostRepository;
import rrrmai.viewbinder.Post;

/**
 * Created by az on 2018/3/23.
 */

public class PostModelFactory implements ViewModelProvider.Factory {

    private final PostRepository postRepository;

    @Inject
    public PostModelFactory(PostRepository postRepository) {
        this.postRepository = postRepository;
    }

    @NonNull
    @Override
    public  PostsViewModel create(@NonNull Class modelClass) {
        return new PostsViewModel(postRepository);
    }
}
